<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>代码详情</title>
    <link rel="icon" href="{{ url_for('static', filename='ico/favicon_curl.png') }}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/show_codes.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/alert_msg.css') }}">
    <script type="module" src="{{ url_for('static', filename='js/show_code.js') }}"></script>

    <!-- 使用 highlight.js -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/python.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            hljs.highlightAll();  // 确保页面加载完成后再初始化 highlight.js
        });
    </script>
</head>
<body>


<!-- 标题 -->
<header class="header">
    <div class="header-title">
        <h2 class="title">{{code_title}}</h2>
        <p class="title-p">代码美化是 Python 的, 其他格式只能说: 有颜色</p>
    </div>
    <div>
        <button class="copy-btn" onclick="copyToClipboard('pythonCode', '脚本代码')">复制</button>
        <button id="backButton" onclick="history.back()">返回</button>
    </div>
</header>


<!-- 代码区 -->
<pre id="pythonCode"><code class="language-python" contenteditable="true">{{ code_info }}</code></pre>

<!-- 自定义通知, 右上角的通知区 -->
<div id="custom-alert" class="custom-alert"></div>

</body>
</html>